package sysu.el.audit;

public class Min2Int {
	int ans1, ans2;
	public Min2Int(int init){
		this.ans1 = init;
		this.ans2 = init;
	}
	
	public Min2Int(){
		this(Integer.MAX_VALUE);
	}
	
	public void reset(){
		this.reset(Integer.MAX_VALUE);
	}
	
	public void reset(int init){
		this.ans1 = init;
		this.ans2 = init;
	}
	
	public void sample(int sam){
		if (sam < this.ans1){
			this.ans2 = this.ans1;
			this.ans1 = sam;
		}
		else if (sam < this.ans2){
			this.ans2 = sam;
		}
	}

	public static Min2Int Ins = new Min2Int();
}
